
<div id="requests-grid">
	<span class="page-heading">Requests:</span><br />
	<div id="requests-container"></div>
	<div id="requests-paginator"></div>
</div>
<div id="vertical-bar"></div>
<div id="offers-grid">
	<span class="page-heading">Offers:</span>
	<div class="add-button"><a href="offerform/0"></a></div><br />
	<div id="offers-container"></div>	
	<div id="offers-paginator"></div>
</div>
<div style="clear: both"></div>


<div class="horizontal-bar"></div>

<div id="new-items-grid">
	<span class="page-subheading">Recommended Items</span>
	&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
	<span class="medium-text" id="item-title"></span>
	<br />
	<div id="new-items-container">
		<span class="control" id="leftControl">left</span>
		<div class="slide-container">
			<?php
				$i = 0;
				if(count($new_items) == 0){
					echo '<div class="slide">';
					echo '<br /><span class="medium-text">No recommended items! Customise your <a href="profile/'.$fb_id.'">Recommendations</a> now!</span>';
					echo '</div>';
				}
				else{
					foreach($new_items as $n){
						if($i % 6 == 0){
							echo '<div class="slide">';
						}
						$more = '';
						if(strlen($n['item_title']) > 30){
							$more = "...";
						}
						echo '<a href="'.base_url('/itemdescription/'.$n['offer_id']) . '"><div class = "img-expand-container"><img class = "resize-100 mouseover" src="resources/offer_images_thumbnail/' . $n['item_pic'] . '" id = "'.$n['offer_id'].'" title="'.$n['item_title'].'"/><div id="offer_'.$n['offer_id'].'" class="hidden-div">'.substr($n['item_title'], 0, 30). $more . ' ' . (($n['item_price'] == "0.00") ? '(Free)' : ('($' . $n['item_price'] . ')')) . '</div></div></a>';
						if($i % 6 == 5){
							echo '</div>';
						}
						$i++;
					}
					if($i % 6 != 0){
						echo '</div>';
					}
				}
			?>
		</div>
		<span class="control" id="rightControl">right</span>
	</div>
</div>

<div class="horizontal-bar"></div>
<div style="height: 20px"></div>


<?php
	$json = json_encode($requests);
	echo '<script type="text/javascript">var requests = ' . $json . ';</script>';
	$json = json_encode($offers);
	echo '<script type="text/javascript">var offers = ' . $json . ';</script>';
?>
